package com.example.data.factory.common.Dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
@Data
public class UpdateInterfaceAndInterfaceParamDto {
    @ApiModelProperty("接口id，自动递增")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("接口名称，不可重复")
    @Pattern( regexp = "^[^\\\\s]+$")
    @Size(max = 100,message = "接口名称长度最长为100个字符")
    private String interfaceName;

    @ApiModelProperty("接口来源（如数据服务、指标管理、决策引擎）")
    private String source;

    @ApiModelProperty("接口描述")
    @Size(max = 1000,message = "接口描述限制1000个字符")
    private String description;

    @ApiModelProperty("接口协议（http，https）")
    private String protocol;

    @ApiModelProperty("接口ip端口")
    private String ipAndProt;

    @ApiModelProperty("接口路径")
    private String path;

    @ApiModelProperty("请求方式（get，post）")
    private String request;

    @ApiModelProperty(value = "超时时间，单位秒，默认30s",example ="30")
    @Min(value = 0,message = "最小为0")
    @Max( value = 1800,message = "最长不超过1800s")
    private Integer timeout;

    @ApiModelProperty("储存用户选择的目录名称")
    private String categoryName;

    @ApiModelProperty("输入参数")
    private String inputParam;

    @ApiModelProperty("输入参数body")
    private String inputParamBody;

    @ApiModelProperty("输出参数body")
    private String outputParam;
}
